package abilities;

/**
 *Class to claculate abilities.
 * 
 * @author bjo013
 * 
 */
public class Abilities
{
	int STR;
	int CON;
	int DEX;
	int INT;
	int WIS;
	int CHA;

	/**
	 * Constructor for abilties.
	 * 
	 * @param STR
	 *            Strength.
	 * @param CON
	 *            Constitution.
	 * @param DEX
	 *            Dexterity
	 * @param INT
	 *            Intelligence.
	 * @param WIS
	 *            Wisdom.
	 * @param CHA
	 *            Charisma
	 */
	public Abilities(int STR, int CON, int DEX, int INT, int WIS, int CHA)
	{
		this.STR = STR;
		this.CON = CON;
		this.DEX = DEX;
		this.INT = INT;
		this.WIS = WIS;
		this.CHA = CHA;
	}

	/**
	 * gets the modifier for the stat.
	 * 
	 * @param ability
	 *            the ability you want.
	 * @return modifier
	 */
	public int getStatMod(Ability ability)
	{
		int score;
		switch (ability)
		{
		case STR:
			score = STR;
			break;
		case CON:
			score = CON;
			break;
		case DEX:
			score = DEX;
			break;
		case INT:
			score = INT;
			break;
		case WIS:
			score = WIS;
			break;
		case CHA:
			score = CHA;
			break;
		default:
			System.out.println("NOT AN ABILITY!!");
			return -10;
		}

		return (score - 10) / 2;
	}

	/**
	 * gets strength
	 * 
	 * @return strength
	 */
	public int getSTR()
	{
		return STR;
	}

	/**
	 * sets strength
	 * 
	 * @param STR
	 */
	public void setSTR(int STR)
	{
		this.STR = STR;
	}

	/**
	 * gets constitution
	 * 
	 * @return constitution
	 */
	public int getCON()
	{
		return CON;
	}

	/**
	 * sets constitution
	 * 
	 * @param CON
	 */
	public void setCON(int CON)
	{
		this.CON = CON;
	}

	/**
	 * gets dexterity
	 * 
	 * @return dexterity
	 */
	public int getDEX()
	{
		return DEX;
	}

	/**
	 * sets dexterity
	 * 
	 * @param DEX
	 * 
	 */
	public void setDEX(int DEX)
	{
		this.DEX = DEX;
	}

	/**
	 * gets intelligence
	 * 
	 * @return intelligence
	 */
	public int getINT()
	{
		return INT;
	}

	/**
	 * sets intelligence
	 * 
	 * @param iNT
	 */
	public void setINT(int iNT)
	{
		INT = iNT;
	}

	/**
	 * gets wisdom
	 * 
	 * @return wisdom
	 */
	public int getWIS()
	{
		return WIS;
	}

	/**
	 * sets wisdom
	 * 
	 * @param wIS
	 */
	public void setWIS(int wIS)
	{
		WIS = wIS;
	}

	/**
	 * gets charisma
	 * 
	 * @return charisma
	 */
	public int getCHA()
	{
		return CHA;
	}

	/**
	 * sets charisma
	 * 
	 * @param cHA
	 */
	public void setCHA(int cHA)
	{
		CHA = cHA;
	}

	@Override
	public String toString()
	{
		String s = new String();
		s += "STR: " + STR + "  CON: " + CON + "\n";
		s += "DEX: " + DEX + "  INT: " + INT + "\n";
		s += "WIS: " + WIS + "  CHA: " + CHA;
		return s;
	}
}